This page last changed on Feb 15, 2006 by cholmes.

Q: How do I set output format for KML?

A:

Google Earth's network link attaches the current BBOX coordinates, so all you really need to do is add a new network link with an valid WMS GetMap request.

1. Open Google Earth

2. Add --> Network Link 

Name: Use any name for your network link

Location: http://geoserver.example.com:8081/geoserver/wms?Service=wms&Version=1.1.0&Request=GetMap&Width=800&Height=800&Srs=EPSG:4326&Bgcolor=0xCEFFFF&Format=image/png&Styles=&Transparent=True&Layers=mykmllayer&

Refresh Parameters: View-Based refresh When: After camera stops (4 secs)

Change &Layers=mykmllayer with a coma separate list of layers to display

3. OK 

Google Earth will then automatically attach BBOX=x1,y1,x2,y2 to the end of each request.

Obviously there are some requirements, such as the SRS is 4326, and the output format is set to whatever the KML handler is. This works for simple WMS PNG output, but I see no reason why this wouldn't work with direct KML output from GeoServer.

Additional information

See: http://chris.narx.net/2006/02/13/geoserver-kml-output/ (if someone could port that to: Google Earth that would be great)

- Width and Height are required parameters. By default I set 800x800

- Format is required by WMS

- Styles is required by WMS (empty)

However, my GE still sending output errors! 

Posted by yecarrillo at Feb 13, 2006 10:47

You can also add a network link that points to the WMS reflector:

http://localhost:8080/geoserver/wms/kml_reflect?layers=myLayer1,myLayer2
It will save you from having to pass in all the parameters.

Posted by bowens at Jun 29, 2006 13:26
Document generated by Confluence on Jan 16, 2008 23:27